/*
 * @Author: jiu yin
 * @Date: 2024-06-13 17:51:10
 * @LastEditTime: 2024-06-19 17:56:58
 * @LastEditors: jiu yin zhen jing
 * @FilePath: \studio-web-admin\src\view\problem\detail.tsx
 * jiu
 */

import React, { useEffect, useState } from "react";
import { useRoute } from "@/hooks";
import { Button } from "antd";
import { ArrowLeftOutlined } from "@ant-design/icons";
import { faq_detail } from "@/api/home";

export default function detail() {
	let { getParams, back,push } = useRoute();
	let { question_id } = getParams();
	let [detail, setDetail] = useState({} as any);
	useEffect(() => {
		faq_detail({ question_id: Number(question_id) }).then((res: any) => {
			setDetail(res.data);
		});
	}, [question_id]);

	return (
		<section className="ml-auto mr-auto w-920px mt-20px">
			 <div dangerouslySetInnerHTML={{ __html: detail.content }} />
			<div className="flex">
				<Button icon={<ArrowLeftOutlined />} onClick={() =>push("/problem") } className="ml-auto mt-40px mb-40px">
					返回常见问题列表
				</Button>
			</div>
		</section>
	);
}
